home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD World Haziran 1997
/
CD World Haziran 1997.iso
/
Explorer Yardimcilari
/
PiXCL Tools
/
Ptdk95a.px_
/
Ptdk95a.px
Encoding:
Amiga (detected)
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
PiXCL source
|
1996-08-06
|
32.0 KB
|
1,080 lines
{ Filename : PTDK95a.pxl
Purpose : PDK Interface
Date : 21 sep 94
Author : S.Dibbs, VYSOR Integration Inc
History:
Update : v4.0 RELEASE
Purpose : Rebuild with PiXCL 4.0 95 and NT
Date : 06 aug 96
-------------------------------------------------------------------------}
Initialize: {only one instance allowed}
InfoMenu(REMOVE)
SetMenu("Initializing ...",IGNORE,ENDPOPUP)
UseCoordinates(PIXEL)
UseFont("Arial",5,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,255)
GetScreenCaps(HORZRES, X_res)
GetScreenCaps(VERTRES, Y_res)
GetScreenCaps(NUMCOLORS, Z_res)
SetColorPalette(BITMAP)
ClipBoardEmpty
WinGetActive(OldCaption$)
Set Title$ = "PiXCL Tools Developer's Kit v4.0"
WinExist(Title$,Res)
If Res = 0 Then Goto One_Instance
Beep
WaitInput(150) Beep WaitInput(150) Beep
WinSetActive(Title$,Res)
WinShow(Title$,RESTORE,Res)
End
{endif}
One_Instance:
WinTitle(OldCaption$,Title$)
Script_File$ = ""
NotePadEdit$ = ""
WriteEdit$ = ""
DirGet(SourceDir$)
DirGetWindows(WindowsDir$)
DirGetSystem(WindowsSysDir$)
INI_File$ = SourceDir$ + "\pdktools.ini"
ResizeFlag = 0
HelpFile$ = SourceDir$ + "\pixclhlp.hlp"
FileRead_INI(INI_File$,"Statusbar","Visible",StatusVis$)
If StatusVis$ = "Y"
StatusWindow(ENABLE,BOTTOM,3,350,500,-1,0)
StatusFlag = 1
Else
StatusFlag = 0
Endif
GoSub FrameLocate
WinShow(Title$,NOTOPMOST,Res)
UseBackground(TRANSPARENT,255,255,255) {white}
UsePen(SOLID,2,0,0,0)
UseBrush(NULL,0,0,0)
DrawBackGround
WaitInput(100)
DirGet(CurrentDir$)
GoSub DrawBanner
WaitInput(100)
DrawBackGround
FileRead_INI(INI_File$,"Toolbar","Visible",ToolVis$)
If ToolVis$ = "Y"
GoSub DrawToolBar
ToolFlag = 1
Else
ToolFlag = 0
Endif
Command_Level:
GoSub Get_FFD_Flag {returns FFD$}
GoSub Get_DevelDir
GoSub Get_Last_Edit
Command_Level_1: {tool buttons are 64 x 64 pixels}
If ToolFlag = 1 Then GoSub MouseButtons
If ToolFlag = 1 Then GoSub MouseHints
SetKeyBoard(112,Toolbox_help)
Wait_for_Input:
WaitInput(100)
SetMenu("&File Operations",IGNORE,
Last_Edit$, Edit_Last,
SEPARATOR,
"&NotePad Edit Source",NotePad_Edit,
"&Write Edit Source",Write_Edit,
SEPARATOR,
"&Acquire/Edit Icon",IconManager,
"Edit &PaintBrush Image",PaintBrush,
"Paint&ShopPro",PaintShopPro,
SEPARATOR,
"&Rename File",Rename_Files,
"Cop&y File",Copy_Files,
"&Delete File",Delete_Files,
SEPARATOR,
"&File Manager",File_Manager,
SEPARATOR,
"Delete File &Check",Preferences,
"Set &Working Directory",WorkingDir,
SEPARATOR,
"E&xit!",Leave,
ENDPOPUP,
"&View",IGNORE,
"&Toolbar",ViewToolbar,
"&StatusBar",ViewStatusBar,
ENDPOPUP,
"&Test PiXCL Script", PiXCL,
ENDPOPUP,
"&Make PiXCL Runtime",PXL_make,
ENDPOPUP,
"&User #2",UserApp_2,
ENDPOPUP,
"&Help",IGNORE,
{"&Windevel Help...F2",WDV_Help,}
"&PiXCL Cmd Reference...F1",Toolbox_Help,
SEPARATOR,
"&About",About,
SEPARATOR,
"Show Active Editors",Show_Active,
SEPARATOR,
"Toggle TopMost",ToggleTopmost,
ENDPOPUP)
If ToolFlag = 0 Then ChangeMenuItem("&Toolbar",UNCHECK,Res)
If ToolFlag = 1 Then ChangeMenuItem("&Toolbar",CHECK,Res)
If StatusFlag = 0 Then ChangeMenuItem("&StatusBar",UNCHECK,Res)
If StatusFlag = 1 Then ChangeMenuItem("&StatusBar",CHECK,Res)
If Last_Edit$ = "No Last Edit available" Then ChangeMenuItem(Last_Edit$,GRAY,Res)
If Last_Edit$ = "" Then ChangeMenuItem(Last_Edit$,GRAY,Res)
If FFD$ = "Y" Then ChangeMenuItem("Delete File &Check",CHECK,Res)
If FFD$ = "N" Then ChangeMenuItem("Delete File &Check",UNCHECK,Res)
WinExist("PiXCL Help v4.0",Rsl)
If Rsl = 1
WinShow("PiXCL Help v4.0",TOPMOST,Res)
Else
{If NotePadEdit$ <> "" Then WinShow(NotePadEdit$,TOPMOST,Res)
If WriteEdit$ <> "" Then WinShow(WriteEdit$,TOPMOST,Res)
If PaintBrushEdit$ <> "" Then WinShow(PaintBrushEdit$,TOPMOST,Res)
If PSPEdit$ <> "" Then WinShow(PSPEdit$,TOPMOST,Res)
}
Endif
Wait_for_Input4:
GoSub UpdateFrameLocate
WaitInput()
ToggleTopmost:
WinShow(Title$,BOTTOM,Res)
Goto Wait_for_Input
ViewToolbar:
If ToolFlag = 1
DrawBackGround
SetMouse()
SetRightMouse()
ToolFlag = 0
ToolVis$ = "N"
FileWrite_INI(INI_File$,"Toolbar","Visible",ToolVis$,Res)
Else
GoSub DrawToolbar
GoSub MouseButtons
GoSub MouseHints
ToolFlag = 1
ToolVis$ = "Y"
FileWrite_INI(INI_File$,"Toolbar","Visible",ToolVis$,Res)
Endif
Goto Wait_for_Input
ViewStatusBar:
If StatusFlag = 1
StatusWindow(DISABLE,BOTTOM,0,0,0,0,0)
StatusFlag = 0
StatusVis$ = "N"
FileWrite_INI(INI_File$,"Statusbar","Visible",StatusVis$,Res)
Else
StatusWindow(ENABLE,BOTTOM,3,200,300,-1,0)
StatusFlag = 1
StatusVis$ = "Y"
FileWrite_INI(INI_File$,"Statusbar","Visible",StatusVis$,Res)
Endif
Goto Wait_for_Input
{======================================================================}
Leave: {shutdown all the processes}
If NotePadEdit$ = "" Then WinClose(NotePadEdit$,Res)
Leave_1:
If WriteEdit$ = "" Then WinClose(WriteEdit$,Res)
Leave_2:
If PaintBrushEdit$ = "" Then WinClose(PaintBrushEdit$,Res)
Leave_3:
If PSPEdit$ = "" Then WinClose(PSPEdit$,Res)
Leave_4:
WinExist("Windevel Visual Shell",Res)
If Res = 0 Then WinClose("Windevel Visual Shell",Res)
Leave_5:
WinExist("PiXCL Help v4.0",Res)
If Res = 0 Then WinClose("PiXCL Help v4.0",Res)
Leave_6:
FreeVarAll
FreeBitMapAll
End
{======================================================================}
Edit_Last: {try to edit the last PXL file accessed. Command Line should be valid}
Set Edit_BLCx = X_Res - 50 Set Edit_BLCy= Y_Res - 60
If Error = 0 then Goto Edit_Last_1
Set CommandLine$ = Last_Edit$
Left(CommandLine$,5,Temp$)
Run(CommandLine$)
Gosub Get_Edit_Window
Edit_Last_1:
Goto Wait_for_Input
{======================================================================}
About:
AboutUser("PiXCL Tools v4.0",
"Developer Shell",
"Windows 95 and NT application written and copyright
⌐ (1994-96) by VYSOR Integration Inc, Gatineau, Quebec.
All Rights Reserved.")
Goto Wait_for_Input
{=====================================================================}
Toolbox_help:
GoSub FlipHelpBtn
WinExist("PiXCL Help v4.0",Res)
If Res = 0 Then WinHelp(HelpFile$,CONTENTS,"")
Toolbox_help_1:
WinShow("PiXCL Help v4.0",TOPMOST,Res)
WinGetLocation(Title$,VDK_x1,VDK_y1,VDK_x2,VDK_y2,Res)
If Res = 1 Then SetCtrlMouse(VDK_x1,VDK_y1,VDK_x2,VDK_y2,Help_to_TOP,X,Y)
Toolbox_help_OK:
Goto Wait_for_Input
Help_to_TOP:
WinShow("PiXCL Help v4.0",TOPMOST,Res)
Goto Wait_for_Input
WDV_Help:
WinExist("Windevel Visual Shell",Res)
If Res = 1 Then Goto WDV_Help_1
CommandLine$ = "winhlp32.exe "
CommandLine$ = CommandLine$ + SourceDir$
CommandLine$ = CommandLine$ + "\windevel.hlp"
Run(CommandLine$)
Goto WDV_Help_OK
{endif}
WDV_Help_1:
WinSetActive("Windevel Visual Shell",Res)
WDV_Help_OK:
Goto Wait_for_Input
{=====================================================================}
File_Manager:
GoSub FlipFileManBtn
CommandLine$ = "WINFILE.EXE"
Run(CommandLine$)
WinGetActive(FileManager$)
Goto Wait_for_Input
{=====================================================================}
NotePad_Edit:
GoSub FlipNotepadBtn
Set Filter$ = "Files(*.pxl;*.txt),*.pxl;*.txt"
Set InitFile$ = "*.pxl"
Set Label$ = "Select the PiXCL script file to edit with NotePad"
NotePad_Edit_1:
Set InitDir$ = CurrentDir$
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR_EXIST,Script_File$)
DirGet(CurrentDir$)
If Script_File$ = "" Then Goto Wait_for_Input {CANCEL chosen}
If Script_File$ = "*.pxl" Then Goto Wait_for_Input {CANCEL chosen}
Set CommandLine$ = "Notepad.exe "
Set CommandLine$ = CommandLine$ + Script_File$
Set Last_Edit$ = CommandLine$
Gosub Update_INI_File
ChangeMenuItem(Last_Edit$,ENABLE,Res)
Set CommandLine$ = Last_Edit$
FileName(Script_File$,Script$,Res)
FileExtension(Script_File$,Ext$,Res) Ext$ = "." + Ext$
NotePadEdit$ = Script$ + Ext$
NotePadEdit$ = NotePadEdit$ + " - Notepad"
Run(CommandLine$)
WinExist(NotePadEdit$,Res)
While Res = 0
WinExist(NotePadEdit$,Res)
WaitInput(1)
EndWhile
WinShow(NotePadEdit$,TOPMOST,Res)
Set Edit_BLCx = X_Res - 50 Set Edit_BLCy = Y_Res - 60
WinLocate(NotePadEdit$,135,126,Edit_BLCx ,Edit_BLCy,Res)
If Filter$ = "Files(*.inf),*.inf" Then Set Script_File$ = ""
DrawStatusWinText(0,Script_File$)
Goto Wait_for_Input
{======================================================================}
Write_Edit:
GoSub FlipWordPadBtn
Set Filter$ = "Files(*.pxl;*.txt),*.pxl;*.txt"
Set InitFile$ = "*.pxl"
Set InitDir$ = CurrentDir$
Set Label$ = "Select the PiXCL script file to edit with Write"
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR_EXIST,Script_File$)
DirGet(CurrentDir$)
If Script_File$ = "" Then Goto Wait_for_Input {CANCEL chosen}
If Script_File$ = "*.pxl" Then Goto Wait_for_Input {CANCEL chosen}
Set CommandLine$ = "write.exe "
Set CommandLine$ = CommandLine$ + Script_File$
Set Last_Edit$ = CommandLine$
Gosub Update_INI_File
ChangeMenuItem(Last_Edit$,ENABLE,Res)
Set CommandLine$ = Last_Edit$
FileName(Script_File$,Script$,Res)
FileExtension(Script_File$,Ext$,Res) Ext$ = "." + Ext$
WriteEdit$ = Script$ + Ext$
WriteEdit$ = WriteEdit$ + " - WordPad"
Run(CommandLine$)
WinExist(WriteEdit$,Res)
While Res = 0
WinExist(WriteEdit$,Res)
WaitInput(1)
EndWhile
WinShow(WriteEdit$,TOPMOST,Res)
Write_Edit_2:
Set Edit_BLCx = X_Res - 50 Set Edit_BLCy= Y_Res - 60
WinLocate(WriteEdit$,135,126,Edit_BLCx ,Edit_BLCy,Res)
DrawStatusWinText(0,Script_File$)
Goto Wait_for_Input
Show_Active: {display the active editors}
Label$ = "Active text or image editors"
If NotePadEdit$ <> ""
WinExist(NotePadEdit$,Res)
If Res = 0
NotePadEdit$ = ""
Else
List$ = NotePadEdit$ + "|"
Endif
Endif
If WriteEdit$ <> ""
WinExist(WriteEdit$,Res)
If Res = 0
WriteEdit$ = ""
Else
List$ = List$ + WriteEdit$
List$ = List$ + "|"
Endif
Endif
If PaintbrushEdit$ <> ""
WinExist(PaintbrushEdit$,Res)
If Res = 0
PaintbrushEdit$ = ""
Else
List$ = List$ + PaintbrushEdit$
List$ = List$ + "|"
Endif
Endif
If PSPEdit$ <> ""
WinExist(PSPEdit$,Res)
If Res = 0
PSPEdit$ = ""
Else
List$ = List$ + PSPEdit$
Endif
Endif
Delimiter$ = "|"
ListBox(Label$, List$, Delimiter$, Res$)
Goto Wait_for_input
{========================================================================}
PaintBrush:
GoSub FlipPaintBtn
Set Filter$ = "Files(*.bmp;*.rle),*.bmp;*.rle"
Set InitFile$ = "*.bmp"
Set InitDir$ = CurrentDir$
Set Label$ = "Select the image file to edit with PaintBrush"
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR_EXIST,Image_File$)
DirGet(CurrentDir$)
If Image_File$ = "" Then Goto Wait_for_Input {CANCEL chosen}
If Image_File$ = InitFile$ Then Goto Wait_for_Input {CANCEL chosen}
WinShow(Title$,NOTOPMOST,Res)
Set CommandLine$ = "pbrush.exe "
Set CommandLine$ = CommandLine$ + Image_File$
FileName(Image_File$,Image$,Res)
FileExtension(Image_File$,Ext$,Res) Ext$ = "." + Ext$
PaintBrushEdit$ = Image$ + Ext$
PaintBrushEdit$ = PaintBrushEdit$ + " - Paint"
Run(CommandLine$)
WinExist(PaintBrushEdit$,Res)
While Res = 0
WinExist(PaintBrushEdit$,Res)
WaitInput(1)
EndWhile
WinShow(PaintBrushEdit$,TOPMOST,Res)
DrawStatusWinText(0,Image_File$)
Goto Wait_for_Input
{========================================================================
Adapt this code for a user defined application. JASC Paint Shop Pro is
the sample application here. It should be either inthe PiXCL application
directory or in the PATH environment string. }
PaintShopPro:
GoSub FlipUser_1_Btn
Set Filter$ = "Files(*.bmp;*.rle),*.bmp;*.rle"
Set InitFile$ = "*.bmp"
Set InitDir$ = CurrentDir$
Set Label$ = "Select the image file to edit with PaintShopPro"
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR_EXIST,Image_File$)
DirGet(CurrentDir$)
If Image_File$ = "" Then Goto Wait_for_Input {CANCEL chosen}
If Image_File$ = InitFile$ Then Goto Wait_for_Input {CANCEL chosen}
Set CommandLine$ = "psp.exe "
EXE_File$ = CommandLine$ Trim(EXE_File$)
FileExist(EXE_File$,Res)
If Res = 1
CommandLine$ = CommandLine$ + Image_File$
Run(CommandLine$)
WinGetActive(PSPEdit$)
DrawStatusWinText(0,Image_File$)
Else
MessageBox(OK,1,EXCLAMATION,
"WARNING: The above file cannot be found in the
installation directory or in the current PATH.
Please correct or re-install the missing file.",
EXE_File$,Res)
Endif
Goto Wait_for_Input
{=====================================================================
Adapt this code for a user defined application. IconManager is
the sample application here. It should be either inthe PiXCL application
directory or in the PATH environment string. }
IconManager:
GoSub FlipIconBtn
CommandLine$ = SourceDir$ + "\iconmn32.exe"
Set EXE_File$ = CommandLine$
FileExist(EXE_File$,Res)
If Res = 0
MessageBox(OK,1,EXCLAMATION,
"WARNING: The above file cannot be found in the
installation directory or in the current PATH.
Please correct or re-install the missing file.",
EXE_File$,Res)
Else
Run(CommandLine$)
Endif
Goto Wait_for_Input
{======================================================================}
Preferences:
{ Update a file on the disk so that the FAST FILE delete provides an
optional check before deleting. The Default is No Check as defined in
the VDKTOOLS.INI file. Options are "Y" or "N". Update the string and write
the .INI file as needed.}
GetMenuStatus("Delete File &Check",CHECKED,Res)
If Res = 0 Then Goto NoCheckPref
FileWrite_INI(INI_File$,"PiXCL_Developer's_Kit","FastFileDel","N",Res)
ChangeMenuItem("Delete File &Check",UNCHECK,Res)
Goto Prefs_Done
NoCheckPref: {else}
FileWrite_INI(INI_File$,"PiXCL_Developer's_Kit","FastFileDel","Y",Res)
ChangeMenuItem("Delete File &Check",CHECK,Res)
{endif}
Prefs_Done:
Goto Wait_for_Input
{======================================================================}
WorkingDir: {Update the .INI file with the latest working directory.}
Set Text$ = "Enter the new working directory:"
Set Label$ = "Change the Development Directory"
Set WorkingDir$ = DevelDir$
TextBox(Text$, Label$,WorkingDir$, Btn)
If WorkingDir$ = "" Then Goto Wait_for_Input
If Btn = 2 Then Goto Wait_for_Input {CANCEL pressed}
DirChange(WorkingDir$,Res)
If Res = 1 Then Goto WorkingDir1
MessageBox(OK,1,STOP,"Specified Directory does not exist.",
"WARNING: incorrect selection",Res)
Goto Wait_for_Input
{endif}
WorkingDir1:
DirChange(SourceDir$,Res) {keep source dir current.}
Set DevelDir$ = WorkingDir$
Set CurrentDir$ = WorkingDir$
GoSub Update_INI_File
Goto Wait_for_Input
{======================================================================}
PiXCL:
GoSub FlipTestScript
Set CommandLine$ = SourceDir$ + "\PiXCL40.exe "
Set EXE_File$ = CommandLine$ Trim(EXE_File$)
If Script_File$ <> ""
Set CommandLine$ = CommandLine$ + Script_File$
Set Script_File$ = ""
Endif
PiXCL_OK:
FileExist(EXE_File$,Res)
If Res = 0
MessageBox(OK,1,STOP,
"WARNING: The above file cannot be found in the
installation directory. Please correct or
re-install the missing file.",
EXE_File$,Res)
Else
Run(CommandLine$)
Endif
Goto Wait_for_Input
{======================================================================}
PXL_make:
GoSub FlipMakeScript
Set CommandLine$ = SourceDir$ + "\PXL_make.exe"
Set EXE_File$ = CommandLine$
FileExist(EXE_File$,Res)
If Res = 0
MessageBox(OK,1,STOP,
"WARNING: The above file cannot be found in the
installation directory. Please correct or
re-install the missing file.",
EXE_File$,Res)
Else
Run(CommandLine$)
Endif
Goto Wait_for_Input
{======================================================================
Adapt this code for a user defined application. userapp2.exe is
the sample application here. It should be either in the PiXCL application
directory or in the PATH environment string. }
UserApp_2:
GoSub FlipUser_2_Btn
DirChange(SourceDir$, Res)
Set CommandLine$ = SourceDir$ + "\userapp2.exe"
Set EXE_File$ = CommandLine$
FileExist(EXE_File$,Res)
If Res = 0
MessageBox(OK,1,STOP,
"WARNING: The above file cannot be found in the
installation directory or in the current PATH.
Please correct or re-install the missing file.",
EXE_File$,Res)
Else
Run(CommandLine$)
Endif
Goto Wait_for_Input
{======================================================================}
Copy_Files:
{ Provide a method to copy files without using the FileManager }
{Get the input file name with FileGet(...) }
Set FF_file$ = ""
Set Filter$ = "All Files(*.*),*.*"
Set InitDir$ = CurrentDir$
Set InitFile$ = ""
FileGet(Filter$, InitFile$, InitDir$,"Select the file to be copied",
CHANGEDIR_EXIST, FF_file$)
If FF_file$ = "" Then FreeVar(Filter$) | Goto Wait_for_Input {CANCEL button pressed}
DirGet(CurrentDir$)
{ Display a TextBox, display the current name, get the new name (OK), or CANCEL }
Copy_Files_1:
Set NewName$ = FF_file$
TextBox("Enter the new filename, then press OK.
Press Cancel to abort the copy process.","Copy a file",NewName$, Btn)
If Btn = 2 Then Goto Wait_for_input {CANCEL pressed}
If FF_File$ <> NewName$ Then Goto Copy_Proceed
MessageBox(OK,1,EXCLAMATION,"You cannot copy a file to itself.",
"Output file naming error",Res)
Goto Copy_Files
{endif}
Copy_Proceed: {check if the target file exists.}
FileExist(NewName$,Res)
If Res = 0 Then Goto Copy_Proceed_1
Set Label$ = NewName$ + " already exists"
MessageBox(OKCANCEL,1,QUESTION,
"Click OK to overwrite, CANCEL to respecify",Label$,Res)
If Res = 2 Then Goto Copy_Files_1
{endif}
Copy_Proceed_1: { issue the FileCopy command. }
FileCopy(FF_file$, NewName$,Res)
If Res = 1 Then Goto Copy_OK_1
MessageBox(OK,1,EXCLAMATION,
"Please take the necessary steps to fix the problem.",
"Error copying to the target file",Res)
{endif}
DrawBackGround
GoSub DrawToolbar
Goto Wait_for_input
Copy_OK_1:
Set Msg$ = "File " + FF_file$
UseFont("Arial",9,21,NOBOLD,ITALIC,NOUNDERLINE,0,255,0)
Drawtext(140,78,Msg$)
Set Msg$ = "copied to " + NewName$
Drawtext(140,102,Msg$)
WaitInput(2000)
DrawBackGround
UseFont("Arial",6,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
GoSub DrawToolbar
Goto Wait_for_input
{======================================================================}
Rename_Files:
{Get the input file name with FileGet(...) }
Set FF_file$ = "" {create a null variable}
Set Filter$ = "All Files(*.*),*.*"
DirGet(InitDir$)
Set InitFile$ = " "
FileGet(Filter$,InitFile$, InitDir$,"Select the file to be renamed",
CHANGEDIR_EXIST, FF_file$)
If FF_file$ = "" Then Goto Wait_for_Input {CANCEL button pressed}
{ Display a TextBox, display the current name, get the new name (OK), or CANCEL }
Set NewName$ = FF_file$
TextBox("Enter the new filename, then press OK.
Press Cancel to leave the name unchanged.","Rename a file",NewName$, Btn)
If Btn = 2 Then Goto Wait_for_input {CANCEL pressed}
{ issue the FileRename command. }
Set Msg$ = "Renaming " + FF_file$
UseFont("Arial",11,10,NOBOLD,ITALIC,NOUNDERLINE,0,255,0)
Drawtext(140,78,Msg$)
Set Msg$ = "to " + NewName$
Drawtext(140,94,Msg$)
FileRename(FF_file$, NewName$,Res)
If Res = 1 Then Goto Rename_OK
DrawBackGround
MessageBox(OK,1,EXCLAMATION,
"Please take the necessary steps to fix the problem.",
"Error renaming the target file",Res)
{endif}
Rename_OK:
DrawBackGround
UseFont("Arial",6,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
GoSub DrawToolBar
Goto Wait_for_input
{======================================================================}
Delete_Files:
{ Provide a fast file delete option, with NO double check for safety, unless the Preference is
enabled }
{Get the input file name with FileGet(...) }
Set NCLabel$ = "FAST FILE DELETE: be very careful ... no safety check !!!"
Set CLabel$ = "FAST FILE DELETE: safety check enabled !!!"
Set FF_file$ = "" {create a null variable}
Set Filter$ = "All Files(*.*),*.*"
DirGet(InitDir$)
Set InitFile$ = " "
GetMenuStatus("Delete File &Check",CHECKED,Res)
If Res = 0 Then FileGet(Filter$,InitFile$, InitDir$, NCLabel$, CHANGEDIR_EXIST, FF_file$)
If Res = 1 Then FileGet(Filter$,InitFile$, InitDir$, CLabel$, CHANGEDIR_EXIST, FF_file$)
If FF_file$ = "" Then Goto Wait_for_Input {CANCEL button pressed}
{ Display a TextBox, display the current name, get the new name (OK), or CANCEL }
If Res = 0 Then Goto Delete_Files_OK1
MessageBox(OKCANCEL,1,QUESTION, "Are you sure", "File Delete Check",Res)
If Res = 2 Then Goto Wait_for_Input
{ else continue}
{endif}
Delete_Files_OK1:
{ issue the FileDelete command. }
FileDelete(FF_file$,Res)
If Res = 1 Then Goto Delete_Files_OK2
MessageBox(OK,1,EXCLAMATION,
"Please take the necessary steps to fix the problem.",
"Error deleting the target file(s)",Res)
Goto Wait_for_input
{endif}
Delete_Files_OK2:
Set Msg$ = FF_file$ + " deleted !"
UseFont("Arial",13,21,NOBOLD,ITALIC,NOUNDERLINE,255,0,0)
Drawtext(140,78,Msg$)
WaitInput(3000)
DrawBackGround
UseFont("Arial",6,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
GoSub DrawToolBar
Goto Wait_for_input
{======================================================================}
DrawBanner: {Subroutine}
AboutUser("PiXCL Tools v4.0",
"PiXCL Script Developer Shell",
"Windows 95 and NT application written and copyright
⌐ (1994-96) by VYSOR Integration Inc, Gatineau, Quebec.
All Rights Reserved.")
Return
{======================================================================}
DrawToolbar: {Subroutine}
UsePen(SOLID,1,0,0,0)
UseBrush(SOLID,192,192,192)
WinGetClientRect(Title$,cx1,cy1,cx2,cy2)
DrawRectangle(-1,-1,cx2,51)
DrawEdgeRectangle( 2, 2, 65,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(18,9,0,0,ICON11) {notepad}
DrawEdgeRectangle( 66, 2,129,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(82,9,0,0,ICON09) {wordpad}
DrawEdgeRectangle(130, 2,193,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(146,9,0,0,ICON13) {paintbrush}
DrawEdgeRectangle(194, 2,259,49,RAISEDEDGE,ADJUST,RECT)
DrawStatusText(196, 4,257,47," User",NOBORDER) {user#1: psp}
DrawEdgeRectangle(260, 2,323,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(276,9,0,0,ICON15) {icon}
DrawEdgeRectangle(324, 2,389,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(340,9,0,0,ICON01) {test}
DrawEdgeRectangle(390, 2,453,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(406,9,0,0,ICON05) {make}
DrawEdgeRectangle(454, 2,519,49,RAISEDEDGE,ADJUST,RECT)
DrawStatusText(456, 4,517,47," User",NOBORDER) {user#2: ???}
DrawEdgeRectangle(520, 2,583,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(536,9,0,0,ICON12) {help}
DrawEdgeRectangle(590, 2,655,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(606,9,0,0,ICON07) {filemanager}
DrawEdgeRectangle(665,2,730,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(681,9,0,0,QUESTION) {context help}
Return
{=======================================================================}
FlipNotePadBtn:
DrawEdgeRectangle( 2, 2, 65,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(19,10,0,0,ICON11)
WaitInput(Button_Pause)
DrawEdgeRectangle( 2, 2, 65,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(18,9,0,0,ICON11)
Return
FlipWordPadBtn:
DrawEdgeRectangle( 66, 2,129,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(83,10,0,0,ICON09)
WaitInput(Button_Pause)
DrawEdgeRectangle( 66, 2,129,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(82,9,0,0,ICON09)
Return
FlipPaintBtn:
DrawEdgeRectangle(130, 2,193,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(147,10,0,0,ICON13)
WaitInput(Button_Pause)
DrawEdgeRectangle(130, 2,193,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(146,9,0,0,ICON13)
Return
FlipUser_1_Btn:
DrawEdgeRectangle(194, 2,259,49,SUNKENEDGE,ADJUST,RECT)
DrawStatusText(197, 5,257,47," User",NOBORDER) {user#1: psp}
WaitInput(Button_Pause)
DrawEdgeRectangle(194, 2,259,49,RAISEDEDGE,ADJUST,RECT)
DrawStatusText(196, 4,257,47," User",NOBORDER) {user#1: psp}
Return
FlipIconBtn:
DrawEdgeRectangle(260, 2,323,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(277,10,0,0,ICON15)
WaitInput(Button_Pause)
DrawEdgeRectangle(260, 2,323,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(276,9,0,0,ICON15)
Return
FlipTestScript:
DrawEdgeRectangle(324, 2,389,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(341,10,0,0,ICON01)
WaitInput(Button_Pause)
DrawEdgeRectangle(324, 2,389,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(340,9,0,0,ICON01)
Return
FlipMakeScript:
DrawEdgeRectangle(390, 2,453,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(407,10,0,0,ICON05)
WaitInput(Button_Pause)
DrawEdgeRectangle(390, 2,453,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(406,9,0,0,ICON05)
Return
FlipUser_2_Btn:
DrawEdgeRectangle(454, 2,519,49,SUNKENEDGE,ADJUST,RECT)
DrawStatusText(197, 5,257,47," User",NOBORDER) {user#1: psp}
WaitInput(Button_Pause)
DrawEdgeRectangle(454, 2,519,49,RAISEDEDGE,ADJUST,RECT)
DrawStatusText(196, 4,257,47," User",NOBORDER) {user#1: psp}
Return
FlipHelpBtn: {subroutine}
DrawEdgeRectangle(520, 2,583,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(537,10,0,0,ICON12)
WaitInput(Button_Pause)
DrawEdgeRectangle(520, 2,583,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(536,9,0,0,ICON12)
Return
FlipFileManBtn:
DrawEdgeRectangle(590, 2,655,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(607,10,0,0,ICON07)
WaitInput(Button_Pause)
DrawEdgeRectangle(590, 2,655,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(606,9,0,0,ICON07)
Return
FlipContextBtn:
DrawEdgeRectangle(665,2,730,49,SUNKENEDGE,ADJUST,RECT)
DrawIcon(682,10,0,0,QUESTION)
WaitInput(Button_Pause)
DrawEdgeRectangle(665,2,730,49,RAISEDEDGE,ADJUST,RECT)
DrawIcon(681,9,0,0,QUESTION)
Return
{======================================================================}
Get_FFD_Flag: {subroutine}
FileRead_INI(INI_File$,"PiXCL_Developer's_Kit","FastFileDel",FFD$)
FileRead_INI(INI_File$,"PiXCL_Developer's_Kit","ButtonPause", BP$)
Val(BP$,Button_Pause,Res)
If Res = 0
MessageBox(OK,1,EXCLAMATION,"ButtonPause value invalid or missing: setting default value !",
"Incorrect INI file entry",Res)
FileWrite_INI(INI_File$,"PiXCL_Developer's_Kit","ButtonPause","200",Res)
Button_Pause = 200
Endif
Return
{======================================================================}
Get_DevelDir: {subroutine}
FileRead_INI(INI_File$,"PiXCL_Developer's_Kit",
"DevelDir",DevelDir$)
If DevelDir$ = "" Then DevelDir$ = SourceDir$
CurrentDir$ = DevelDir$
Return
{======================================================================}
Update_INI_File: {subroutine: update the .INI file with the new working dir}
FileWrite_INI(INI_File$,"PiXCL_Developer's_Kit",
"DevelDir",DevelDir$,Res)
FileWrite_INI(INI_File$,"PiXCL_Developer's_Kit",
"LastEdit",Last_Edit$,Res)
If Res = 1 Then Return
MessageBox(OK,1,EXCLAMATION,"Unable to update pdktools.ini",
"WARNING: Unexpected action failure.",Res)
Error = 0
Return
{=======Subroutine=======================================================}
Get_Edit_Window:
If Temp$ = "write" Then Goto Get_Edit_Window1
WinGetActive(NotePadEdit$)
WinLocate(NotePadEdit$,135,126,Edit_BLCx,Edit_BLCy,Res)
Set Error = 1
Goto Get_Edit_Done
{endif}
Get_Edit_Window1:
SetWaitMode(NULL)
WinGetActive(WriteEdit$)
WaitInput(1)
Get_Edit_Window1a: {for}
If WriteEdit$ <> "Write" then Goto Get_Edit_Window2
WaitInput(100)
WinGetActive(WriteEdit$)
Goto Get_Edit_Window1a
{end for}
Get_Edit_Window2:
WinLocate(WriteEdit$,135,126,Edit_BLCx ,Edit_BLCy,Res)
Get_Edit_Done:
Return
{======================================================================}
Get_Last_Edit:
Set Last_Edit$ = "No Last Edit available"
FileRead_INI(INI_File$,"PiXCL_Developer's_Kit","LastEdit",Last_Edit$)
If Last_Edit$ = "No String"
Last_Edit$ = "No Last Edit available"
Error = 0
Return
Endif
Error = 1
CommandLine$ = Last_Edit$
Return
{======================================================================}
FrameLocate:
FileRead_INI(INI_File$,"Frame","Left",Left$) Val(Left$,wx1,Res)
FileRead_INI(INI_File$,"Frame","Top",Top$) Val(Top$,wy1,Res)
FileRead_INI(INI_File$,"Frame","Right",Right$) Val(Right$,wx2,Res)
FileRead_INI(INI_File$,"Frame","Bottom",Bottom$) Val(Bottom$,wy2,Res)
WinLocate(Title$,wx1,wy1,wx2,wy2,Res)
wxx1 = wx1 wyy1 = wy1 wxx2 = wx2 wyy2 = wy2
Return
UpdateFrameLocate:
WinGetLocation(Title$,wx1,wy1,wx2,wy2,Res)
If wx1 <> wxx1 Then ResizeFlag = 1
If wx2 <> wxx2 Then ResizeFlag = 1
If wy1 <> wyy1 Then ResizeFlag = 1
If wy2 <> wyy2 Then ResizeFlag = 1
If ResizeFlag = 1
Str(wx1,Left$) Str(wy1,Top$) Str(wx2,Right$) Str(wy2,Bottom$)
FileWrite_INI(INI_File$,"Frame","Left",Left$,Res) Val(Left$,wx1,Res)
FileWrite_INI(INI_File$,"Frame","Top",Top$,Res) Val(Top$,wy1,Res)
FileWrite_INI(INI_File$,"Frame","Right",Right$,Res) Val(Right$,wx2,Res)
FileWrite_INI(INI_File$,"Frame","Bottom",Bottom$,Res) Val(Bottom$,wy2,Res)
wxx1 = wx1 wyy1 = wy1 wxx2 = wx2 wyy2 = wy2
ResizeFlag = 0
GoSub DrawToolbar
Endif
Return
{===========================================================================}
MouseButtons:
SetMouse( 2,2, 65,49,NotePad_Edit,X,Y,
66,2,129,49,Write_Edit,X,Y,
130,2,193,49,PaintBrush,X,Y,
194,2,257,49,PaintShopPro,X,Y,
258,2,321,49,IconManager,X,Y,
322,2,385,49,PiXCL,X,Y,
386,2,449,49,PXL_make,X,Y,
450,2,513,49,UserApp_2,X,Y,
514,2,577,49,Toolbox_Help,X,Y,
590,2,653,49,File_Manager,X,Y,
1,50,X_res,Y_res,Wait_for_input,X,Y)
Return
MouseHints:
SetRightMouse( 2,2, 65,49,NotePad_Edit_ID,hX,hY,
66,2,129,49,Write_Edit_ID,hX,hY,
130,2,193,49,PaintBrush_ID,hX,hY,
194,2,257,49,PaintShopPro_ID,hX,hY,
258,2,321,49,IconManager_ID,hX,hY,
322,2,385,49,PiXCL_ID,hX,hY,
386,2,449,49,PXL_make_ID,hX,hY,
450,2,513,49,UserApp2_ID,hX,hY,
514,2,577,49,Toolbox_Help_ID,hX,hY,
590,2,653,49,File_Manager_ID,hX,hY,
665,2,730,49,Context_Help,X,Y)
Return
NotePad_Edit_ID:
Msg$ = "MS NotePad" Goto ShowHint
Write_Edit_ID:
Msg$ = "MS WordPad" Goto ShowHint
PaintBrush_ID:
Msg$ = "MS Paint" Goto ShowHint
PaintShopPro_ID:
Msg$ = "User Defined" Goto ShowHint
IconManager_ID:
Msg$ = "Icon Tool" Goto ShowHint
PiXCL_ID:
Msg$ = "Test Script" Goto ShowHint
PXL_make_ID:
Msg$ = "Make EXE" Goto ShowHint
UserApp2_ID:
Msg$ = "User defined" Goto ShowHint
Toolbox_Help_ID:
Msg$ = "PiXCL Help" Goto ShowHint
File_Manager_ID:
Msg$ = "FileManager"
ShowHint:
SetMouse()
hX2 = hX + 90 hY = 60 hY2= 78
hX3 = hX + 5 hY3 = 61
UseBrush(SOLID,255,255,255)
UsePen(SOLID,1,255,255,255)
DrawRectangle(wx1,hY,wx2,hY2)
UseFont("Arial",6,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
UseBrush(SOLID,255,255,128)
UsePen(SOLID,1,0,0,0)
DrawRectangle(hX,hY,hX2,hY2)
DrawText(hX3,hY3,Msg$)
WaitInput(1200)
UseBrush(SOLID,255,255,255)
UsePen(SOLID,1,255,255,255)
DrawRectangle(wx1,hY,wx2,hY2)
GoSub MouseButtons
Goto Wait_for_Input
Context_Help: {PiXCL Command context help}
GoSub FlipContextBtn
ClipBoardGet(PiXCLcmd$,Res)
NoCmd = 1
If PiXCLcmd$ = ""
MessageBox(OK,1,INFORMATION,
"To get context sensitive Help, select the command
in the current editor (e.g. NotePad or WordPad),
Ctrl-C to copy to the clipboard, then using the
Right mouse, click the Question icon on the toolbar.",
"Getting Context Sensitive Help",Res)
NoCmd = 0
Endif
If NoCmd = 0 Then Goto Wait_for_Input
Context_Help_1: { construct the help command}
WinHelp(HelpFile$,KEY,PiXCLcmd$)
Goto Wait_for_Input